{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Create a Graph from a text"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This notebook demonstrates how to extract graph from any text using the graph maker\n",
    "\n",
    "Steps:\n",
    "- Define an Ontology\n",
    "- Load a list of example text chunks. We will use the Lord of the Rings summary from this wikipedia page. \n",
    "- Create Graph using an Open source model using Groq APIs. \n",
    "- Save the graph to Neo4j db\n",
    "- Visualise\n",
    "\n",
    "\n",
    "\n",
    "Loading the graph maker functions ->"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "from graph_maker import GraphMaker, Ontology, GroqClient\n",
    "from graph_maker import Document\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Define the Ontology. \n",
    "\n",
    "The ontology is a pydantic model with the following schema. \n",
    "\n",
    "```python\n",
    "class Ontology(BaseModel):\n",
    "    label: List[Union[str, Dict]]\n",
    "    relationships: List[str]\n",
    "```\n",
    "\n",
    "Here is the ontology we will use for the LOTR summaries ->\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "ontology = Ontology(\n",
    "    labels=[\n",
    "        {\"Person\": \"Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun\"},\n",
    "        {\"Object\": \"Do not add the definite article 'the' in the object name\"},\n",
    "        {\"Event\": \"Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.\"},\n",
    "        \"Place\",\n",
    "        \"Document\",\n",
    "        \"Organisation\",\n",
    "        \"Action\",\n",
    "        {\"Miscellaneous\": \"Any important concept can not be categorised with any other given label\"},\n",
    "    ],\n",
    "    relationships=[\n",
    "        \"Relation between any pair of Entities\"\n",
    "        ],\n",
    ")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "List of text chunks. These are the summaries of the LOTR books from the Wikipedia page. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from lotr_wikipedia_summary import lord_of_the_rings_wikipedia_summary as example_text_list\n",
    "len(example_text_list)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Select a Model\n",
    "\n",
    "Groq support the following models at present. \n",
    "\n",
    "*LLaMA3 8b*\n",
    "Model ID: llama3-8b-8192\n",
    "\n",
    "*LLaMA3 70b*\n",
    "Model ID: llama3-70b-8192\n",
    "\n",
    "*Mixtral 8x7b*\n",
    "Model ID: mixtral-8x7b-32768\n",
    "\n",
    "*Gemma 7b*\n",
    "Model ID: gemma-7b-it\n",
    "\n",
    "\n",
    "Selecting a model for this example ->\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "model = \"mixtral-8x7b-32768\"\n",
    "# model =\"llama3-8b-8192\"\n",
    "# model = \"llama3-70b-8192\"\n",
    "# model=\"gemma-7b-it\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Create documents out of text chumks. \n",
    "Documents is a pydantic model with the following schema \n",
    "\n",
    "```python\n",
    "class Document(BaseModel):\n",
    "    text: str\n",
    "    metadata: dict\n",
    "```\n",
    "\n",
    "The metadata we add to the document here is copied to every relation that is extracted out of the document. More often than not, the node pairs have multiple relation with each other. The metadata helps add more context to these relations\n",
    "\n",
    "In this example I am generating a summary of the text chunk, and the timestamp of the run, to be used as metadata. \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime\n",
    "current_time = str(datetime.datetime.now())\n",
    "llm = GroqClient(model=model, temperature=0.1, top_p=0.5)\n",
    "graph_maker = GraphMaker(ontology=ontology, llm_client=llm, verbose=False)\n",
    "\n",
    "def generate_summary(text):\n",
    "    SYS_PROMPT = (\n",
    "        \"Succintly summarise the text provided by the user. \"\n",
    "        \"Respond only with the summary and no other comments\"\n",
    "    )\n",
    "    try:\n",
    "        summary = llm.generate(user_message=text, system_message=SYS_PROMPT)\n",
    "    except:\n",
    "        summary = \"\"\n",
    "    finally:\n",
    "        return summary\n",
    "\n",
    "\n",
    "docs = map(\n",
    "    lambda t: Document(text=t, metadata={\"summary\": generate_summary(t), 'generated_at': current_time}),\n",
    "    example_text_list\n",
    ")\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Create Graph\n",
    "Finally run the Graph Maker to generate graph. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 1.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 6.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 7.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 7.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 8.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 9.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 6.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:00:01 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 1\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:00:01 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 429 Too Many Requests\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 17.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:00:21 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"birthday celebration\"},\n",
      " \"relationship\": \"Bilbo Baggins hosts the birthday celebration\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Bilbo Baggins leaves the Ring to Frodo\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Bilbo Baggins identifies Frodo as his heir\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Gandalf suspects the Ring is a Ring of Power\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Seventeen years later, Gandalf confirms the Ring was lost by the Dark Lord Sauron\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Gandalf counsels Frodo to take the Ring away from the Shire\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"relationship\": \"Frodo sets out on foot with his cousin Pippin Took\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sam Gamgee\"},\n",
      " \"relationship\": \"Frodo sets out on foot with his gardener Sam Gamgee\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"Black Riders\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"The Black Riders pursue Frodo\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"Elves\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Black Riders\"},\n",
      " \"relationship\": \"The Elves' singing to Elbereth wards off the Riders\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Bucklebury Ferry\"},\n",
      " \"relationship\": \"The Hobbits take an evasive shortcut to Bucklebury Ferry\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Merry meets Frodo at Bucklebury Ferry\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"relationship\": \"Merry knows Pippin Took\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Merry knows about the Ring\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Merry insists on joining Frodo on his journey\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Pippin knows about the Ring\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:00:21 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"birthday celebration\"},\n",
      " \"relationship\": \"Bilbo Baggins hosts the birthday celebration\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Bilbo Baggins leaves the Ring to Frodo\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Bilbo Baggins\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Bilbo Baggins identifies Frodo as his heir\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Gandalf suspects the Ring is a Ring of Power\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Seventeen years later, Gandalf confirms the Ring was lost by the Dark Lord Sauron\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Gandalf counsels Frodo to take the Ring away from the Shire\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"relationship\": \"Frodo sets out on foot with his cousin Pippin Took\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sam Gamgee\"},\n",
      " \"relationship\": \"Frodo sets out on foot with his gardener Sam Gamgee\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"Black Riders\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"The Black Riders pursue Frodo\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"Elves\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Black Riders\"},\n",
      " \"relationship\": \"The Elves' singing to Elbereth wards off the Riders\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Bucklebury Ferry\"},\n",
      " \"relationship\": \"The Hobbits take an evasive shortcut to Bucklebury Ferry\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Merry meets Frodo at Bucklebury Ferry\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"relationship\": \"Merry knows Pippin Took\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Merry knows about the Ring\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Merry Brandybuck\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"Merry insists on joining Frodo on his journey\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin Took\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"relationship\": \"Pippin knows about the Ring\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:00:21 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:01:11 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 2\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:01:11 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:01:13 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"try to shake off the Black Riders\"},\n",
      "\"relationship\": \"The Black Riders are being shaken off\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Event\", \"name\": \"try to shake off the Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Old Forest\"},\n",
      "\"relationship\": \"The event of shaking off the Black Riders occurs in the Old Forest\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"relationship\": \"Merry and Pippin are together\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Merry and Pippin\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"trapped by the malign Old Man Willow\"},\n",
      "\"relationship\": \"Merry and Pippin are trapped by the malign Old Man Willow\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Tom Bombadil\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"rescued by Tom Bombadil\"},\n",
      "\"relationship\": \"Tom Bombadil rescues Merry and Pippin\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Tom Bombadil\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"ancient swords\"},\n",
      "\"relationship\": \"Tom Bombadil gives ancient swords\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"village of Bree\"},\n",
      "\"relationship\": \"The Hobbits reach the village of Bree\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"innkeeper\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"The innkeeper gives Frodo an old letter\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"relationship\": \"Gandalf's old letter identifies Strider as a friend\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"guides the group toward the Elvish sanctuary of Rivendell\"},\n",
      "\"relationship\": \"Strider guides the group toward the Elvish sanctuary of Rivendell\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"The Black Riders will attempt to seize the Ring from Frodo\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:01:13 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"try to shake off the Black Riders\"},\n",
      "\"relationship\": \"The Black Riders are being shaken off\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Event\", \"name\": \"try to shake off the Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Old Forest\"},\n",
      "\"relationship\": \"The event of shaking off the Black Riders occurs in the Old Forest\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"relationship\": \"Merry and Pippin are together\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Merry and Pippin\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"trapped by the malign Old Man Willow\"},\n",
      "\"relationship\": \"Merry and Pippin are trapped by the malign Old Man Willow\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Tom Bombadil\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"rescued by Tom Bombadil\"},\n",
      "\"relationship\": \"Tom Bombadil rescues Merry and Pippin\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Tom Bombadil\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"ancient swords\"},\n",
      "\"relationship\": \"Tom Bombadil gives ancient swords\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"village of Bree\"},\n",
      "\"relationship\": \"The Hobbits reach the village of Bree\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"innkeeper\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"The innkeeper gives Frodo an old letter\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"relationship\": \"Gandalf's old letter identifies Strider as a friend\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"guides the group toward the Elvish sanctuary of Rivendell\"},\n",
      "\"relationship\": \"Strider guides the group toward the Elvish sanctuary of Rivendell\"\n",
      "},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Black Riders\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"The Black Riders will attempt to seize the Ring from Frodo\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:01:13 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:02:03 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 3\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:02:03 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 503 Service Unavailable\"\n",
      "INFO:groq._base_client:Retrying request to /openai/v1/chat/completions in 5.000000 seconds\n",
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:02:10 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Weathertop\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"attacked by five Black Riders\"},\n",
      "\"relationship\": \"The event of being attacked by five Black Riders occurred at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"wounds\"},\n",
      "\"relationship\": \"A Black Rider wounded Frodo with a cursed blade during the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"fights off\"},\n",
      "\"relationship\": \"Strider fought off the Black Riders during the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"treats\"},\n",
      "\"relationship\": \"Strider treated Frodo with the herb athelas after the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Glorfindel\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"rides with\"},\n",
      "\"relationship\": \"Glorfindel rode with Frodo towards Rivendell after the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ford of Bruinen\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"pursue Frodo\"},\n",
      "\"relationship\": \"The Black Riders pursued Frodo towards the Ford of Bruinen.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ford of Bruinen\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"swept away\"},\n",
      "\"relationship\": \"The Black Riders were swept away by flood waters at the Ford of Bruinen.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Rivendell\"},\n",
      "\"relationship\": \"Frodo recovered in Rivendell under Elrond's care after being wounded by the Black Rider.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Gandalf informed Frodo that the Black Riders are the Nazgûl, Men enslaved by Rings of Power to serve Sauron.\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:02:10 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Weathertop\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"attacked by five Black Riders\"},\n",
      "\"relationship\": \"The event of being attacked by five Black Riders occurred at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"wounds\"},\n",
      "\"relationship\": \"A Black Rider wounded Frodo with a cursed blade during the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"fights off\"},\n",
      "\"relationship\": \"Strider fought off the Black Riders during the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"treats\"},\n",
      "\"relationship\": \"Strider treated Frodo with the herb athelas after the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Glorfindel\"},\n",
      "\"node_2\": {\"label\": \"Action\", \"name\": \"rides with\"},\n",
      "\"relationship\": \"Glorfindel rode with Frodo towards Rivendell after the attack at Weathertop.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ford of Bruinen\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"pursue Frodo\"},\n",
      "\"relationship\": \"The Black Riders pursued Frodo towards the Ford of Bruinen.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ford of Bruinen\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"swept away\"},\n",
      "\"relationship\": \"The Black Riders were swept away by flood waters at the Ford of Bruinen.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Rivendell\"},\n",
      "\"relationship\": \"Frodo recovered in Rivendell under Elrond's care after being wounded by the Black Rider.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Gandalf informed Frodo that the Black Riders are the Nazgûl, Men enslaved by Rings of Power to serve Sauron.\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:02:10 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:00 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 4\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:03:00 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:03:02 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Council of Elrond\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"discusses what to do with the Ring\"},\n",
      " \"relationship\": \"The Council of Elrond is discussing the matter of what to do with the Ring.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"relationship\": \"Strider is revealed to be Aragorn.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"relationship\": \"Aragorn is the heir of Isildur.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"cut the Ring from Sauron's hand\"},\n",
      " \"relationship\": \"Isildur had cut the Ring from Sauron's hand.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"cut the Ring from Sauron's hand\"},\n",
      " \"node_2\": {\"label\": \"Time\", \"name\": \"Second Age\"},\n",
      " \"relationship\": \"The event of cutting the Ring from Sauron's hand occurred during the Second Age.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"claimed the Ring for himself\"},\n",
      " \"relationship\": \"Isildur claimed the Ring for himself after cutting it from Sauron's hand.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"relationship\": \"The Ring was lost when Isildur was killed.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      " \"relationship\": \"The Ring passed to Gollum after Isildur's death.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Bilbo\"},\n",
      " \"relationship\": \"The Ring then passed to Bilbo from Gollum.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"relationship\": \"Gandalf reports that the chief wizard, Saruman, is a traitor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"destroy the Ring\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mount Doom\"},\n",
      " \"relationship\": \"The Council decides that the Ring must be destroyed in the fire of Mount Doom.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"destroy the Ring\"},\n",
      " \"relationship\": \"Frodo takes the task of destroying the Ring upon himself.\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:02 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Council of Elrond\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"discusses what to do with the Ring\"},\n",
      " \"relationship\": \"The Council of Elrond is discussing the matter of what to do with the Ring.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Strider\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"relationship\": \"Strider is revealed to be Aragorn.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"relationship\": \"Aragorn is the heir of Isildur.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"cut the Ring from Sauron's hand\"},\n",
      " \"relationship\": \"Isildur had cut the Ring from Sauron's hand.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"cut the Ring from Sauron's hand\"},\n",
      " \"node_2\": {\"label\": \"Time\", \"name\": \"Second Age\"},\n",
      " \"relationship\": \"The event of cutting the Ring from Sauron's hand occurred during the Second Age.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"claimed the Ring for himself\"},\n",
      " \"relationship\": \"Isildur claimed the Ring for himself after cutting it from Sauron's hand.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Isildur\"},\n",
      " \"relationship\": \"The Ring was lost when Isildur was killed.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      " \"relationship\": \"The Ring passed to Gollum after Isildur's death.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Bilbo\"},\n",
      " \"relationship\": \"The Ring then passed to Bilbo from Gollum.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"relationship\": \"Gandalf reports that the chief wizard, Saruman, is a traitor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"destroy the Ring\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mount Doom\"},\n",
      " \"relationship\": \"The Council decides that the Ring must be destroyed in the fire of Mount Doom.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"destroy the Ring\"},\n",
      " \"relationship\": \"Frodo takes the task of destroying the Ring upon himself.\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:02 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:52 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 5\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:03:52 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:03:55 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"companions\"},\n",
      " \"relationship\": \"Elrond chooses companions for him\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"relationship\": \"Elrond chooses Sam as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      " \"relationship\": \"Elrond chooses Merry as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"relationship\": \"Elrond chooses Pippin as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Gandalf is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Aragorn is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Boromir is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Legolas is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gimli\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Gimli is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Place\", \"name\": \"Misty Mountains\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship attempts to cross the Misty Mountains\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Place\", \"name\": \"Mines of Moria\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship risks the path through the Mines of Moria\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Balin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mines of Moria\"},\n",
      " \"relationship\": \"Balin and his Dwarves were killed by Orcs in the Mines of Moria\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Orcs\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship is attacked by Orcs\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Balrog\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship is attacked by a Balrog\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Balrog\"},\n",
      " \"relationship\": \"Gandalf confronts the Balrog\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:55 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"companions\"},\n",
      " \"relationship\": \"Elrond chooses companions for him\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"relationship\": \"Elrond chooses Sam as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      " \"relationship\": \"Elrond chooses Merry as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"relationship\": \"Elrond chooses Pippin as one of his companions\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Gandalf is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Aragorn is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Boromir is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Legolas is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gimli\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Elrond\"},\n",
      " \"relationship\": \"Gimli is one of the companions chosen by Elrond\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Place\", \"name\": \"Misty Mountains\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship attempts to cross the Misty Mountains\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Place\", \"name\": \"Mines of Moria\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship risks the path through the Mines of Moria\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Balin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mines of Moria\"},\n",
      " \"relationship\": \"Balin and his Dwarves were killed by Orcs in the Mines of Moria\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Orcs\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship is attacked by Orcs\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Balrog\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Fellowship\"},\n",
      " \"relationship\": \"The Fellowship is attacked by a Balrog\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Balrog\"},\n",
      " \"relationship\": \"Gandalf confronts the Balrog\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:03:55 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:04:45 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 6\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:04:45 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"the others\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"escape to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"tests their loyalty in and gives them magical gifts at\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"allows to look into her vision-giving fountain, the Mirror of Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"offers to Lady Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"refuses, knowing that it would master her\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"the Fellowship\"},\n",
      " \"relationship\": \"gives boats, cloaks, and waybread to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"tries to take\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"puts on the Ring\"},\n",
      " \"relationship\": \"and disappears\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      " \"relationship\": \"chooses to cross the river and go alone to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"guessing what he intends, intercepts him\"}\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"the others\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"escape to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"tests their loyalty in and gives them magical gifts at\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"allows to look into her vision-giving fountain, the Mirror of Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"offers to Lady Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"refuses, knowing that it would master her\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"the Fellowship\"},\n",
      " \"relationship\": \"gives boats, cloaks, and waybread to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"tries to take\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"puts on the Ring\"},\n",
      " \"relationship\": \"and disappears\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      " \"relationship\": \"chooses to cross the river and go alone to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"guessing what he intends, intercepts him\"}\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[35m\u001b[39m\n",
      "\u001b[35m▶︎ GRAPH MAKER ERROR - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[35mJSON Parsing failed with error: Expecting ',' delimiter\u001b[39m\n",
      "\u001b[35m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[34mFAULTY JSON: [\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"the others\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"escape to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"tests their loyalty in and gives them magical gifts at\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"allows to look into her vision-giving fountain, the Mirror of Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"offers to Lady Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"refuses, knowing that it would master her\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"the Fellowship\"},\n",
      " \"relationship\": \"gives boats, cloaks, and waybread to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"tries to take\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"puts on the Ring\"},\n",
      " \"relationship\": \"and disappears\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      " \"relationship\": \"chooses to cross the river and go alone to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"guessing what he intends, intercepts him\"}\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[92mTrying Manual Parsing: \n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"the others\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"escape to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Elvish forest of Lothlórien\"},\n",
      " \"relationship\": \"tests their loyalty in and gives them magical gifts at\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"allows to look into her vision-giving fountain, the Mirror of Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"offers to Lady Galadriel\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Lady Galadriel\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"refuses, knowing that it would master her\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"the Fellowship\"},\n",
      " \"relationship\": \"gives boats, cloaks, and waybread to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"the Ring\"},\n",
      " \"relationship\": \"tries to take\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Action\", \"name\": \"puts on the Ring\"},\n",
      " \"relationship\": \"and disappears\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      " \"relationship\": \"chooses to cross the river and go alone to\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      " \"relationship\": \"guessing what he intends, intercepts him\"}\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:04:47 - INFO \u001b[39m\n",
      "\u001b[92mManually exracted 10 Edges\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:05:37 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 7\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:05:37 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:05:41 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Event\", \"name\": \"attack the Fellowship\"},\"relationship\": \"The Orcs are the entities that carry out the attack on the Fellowship\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\"relationship\": \"Boromir tries to protect Merry from the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\"relationship\": \"Boromir also tries to protect Pippin from the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"relationship\": \"The Orcs kill Boromir\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\"relationship\": \"The Orcs capture Merry and Pippin\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gimli\"},\"relationship\": \"Aragorn and Gimli decide to pursue the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"relationship\": \"Legolas joins Aragorn and Gimli in pursuing the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Riders of Rohan\"},\"relationship\": \"The Orcs are killed by the Riders of Rohan\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Riders of Rohan\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Éomer\"},\"relationship\": \"The Riders of Rohan are led by Éomer\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Fangorn Forest\"},\"relationship\": \"The Hobbits escape into Fangorn Forest\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Ent Treebeard\"},\"relationship\": \"The Hobbits are befriended by Ent Treebeard in Fangorn Forest\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gimli\"},\"relationship\": \"Aragorn and Gimli track the Hobbits to Fangorn\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"relationship\": \"Legolas also joins Aragorn and Gimli in tracking the Hobbits to Fangorn\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Balrog\"},\"relationship\": \"Gandalf explains that he killed the Balrog\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"relationship\": \"Gandalf was killed in the fight with the Balrog, but was sent back to Middle-earth\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf the White\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\"relationship\": \"Gandalf the White replaces Saruman as chief of the wizards\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Edoras\"},\"relationship\": \"Gandalf rides to Edoras, capital of Rohan\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\"relationship\": \"Gandalf frees King Théoden from the influence of Saruman's spy Gríma Wormtongue\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Helm's Deep\"},\"relationship\": \"Théoden musters his army and rides to the fortress of Helm's Deep\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Treebeard\"},\"relationship\": \"Gandalf departs to seek help from Treebeard\"}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:05:41 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Event\", \"name\": \"attack the Fellowship\"},\"relationship\": \"The Orcs are the entities that carry out the attack on the Fellowship\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\"relationship\": \"Boromir tries to protect Merry from the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\"relationship\": \"Boromir also tries to protect Pippin from the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Boromir\"},\"relationship\": \"The Orcs kill Boromir\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\"relationship\": \"The Orcs capture Merry and Pippin\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gimli\"},\"relationship\": \"Aragorn and Gimli decide to pursue the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"relationship\": \"Legolas joins Aragorn and Gimli in pursuing the Orcs\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Orcs\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Riders of Rohan\"},\"relationship\": \"The Orcs are killed by the Riders of Rohan\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Riders of Rohan\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Éomer\"},\"relationship\": \"The Riders of Rohan are led by Éomer\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Fangorn Forest\"},\"relationship\": \"The Hobbits escape into Fangorn Forest\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Hobbits\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Ent Treebeard\"},\"relationship\": \"The Hobbits are befriended by Ent Treebeard in Fangorn Forest\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gimli\"},\"relationship\": \"Aragorn and Gimli track the Hobbits to Fangorn\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Legolas\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\"relationship\": \"Legolas also joins Aragorn and Gimli in tracking the Hobbits to Fangorn\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Balrog\"},\"relationship\": \"Gandalf explains that he killed the Balrog\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"relationship\": \"Gandalf was killed in the fight with the Balrog, but was sent back to Middle-earth\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf the White\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\"relationship\": \"Gandalf the White replaces Saruman as chief of the wizards\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Edoras\"},\"relationship\": \"Gandalf rides to Edoras, capital of Rohan\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\"relationship\": \"Gandalf frees King Théoden from the influence of Saruman's spy Gríma Wormtongue\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\"node_2\": {\"label\": \"Place\", \"name\": \"Helm's Deep\"},\"relationship\": \"Théoden musters his army and rides to the fortress of Helm's Deep\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Treebeard\"},\"relationship\": \"Gandalf departs to seek help from Treebeard\"}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:05:41 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:06:31 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 8\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:06:31 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:06:33 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Ents\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Isengard\"},\n",
      "\"relationship\": \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Orthanc\"},\n",
      "\"relationship\": \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"Gandalf convinces Treebeard to send an army of Huorns to Théoden's aid.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Riders of Rohan\"},\n",
      "\"relationship\": \"He brings an army of Riders of Rohan to Helm's Deep.\"},\n",
      "{\"node_1\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"forest of Huorns\"},\n",
      "\"relationship\": \"The Orcs flee into the forest of Huorns and are destroyed.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"relationship\": \"Gandalf, Théoden, Aragorn, Legolas, and Gimli ride to Isengard,\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"relationship\": \"They find Merry and Pippin relaxing amidst the ruins.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"relationship\": \"Gandalf offers Saruman a chance to turn away from evil.\"}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:06:33 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Ents\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Isengard\"},\n",
      "\"relationship\": \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Orthanc\"},\n",
      "\"relationship\": \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"Gandalf convinces Treebeard to send an army of Huorns to Théoden's aid.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Riders of Rohan\"},\n",
      "\"relationship\": \"He brings an army of Riders of Rohan to Helm's Deep.\"},\n",
      "{\"node_1\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"forest of Huorns\"},\n",
      "\"relationship\": \"The Orcs flee into the forest of Huorns and are destroyed.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"relationship\": \"Gandalf, Théoden, Aragorn, Legolas, and Gimli ride to Isengard,\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"relationship\": \"They find Merry and Pippin relaxing amidst the ruins.\"},\n",
      "{\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"relationship\": \"Gandalf offers Saruman a chance to turn away from evil.\"}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:06:33 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:07:23 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 9\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:07:23 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:07:26 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"relationship\": \"Gandalf strips Saruman of his rank and most of his powers\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Wormtongue throws down a hard round object to try to kill Gandalf\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Pippin picks up the hard round object\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Gandalf swiftly takes the hard round object from Pippin\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Pippin steals the hard round object in the night\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"relationship\": \"The hard round object is a palantír, a seeing-stone\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"relationship\": \"Saruman used the palantír to speak with Sauron\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"relationship\": \"Sauron sees Pippin through the palantír\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"relationship\": \"Sauron misunderstands the circumstances of seeing Pippin\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"Gandalf rides for Minas Tirith, taking Pippin with him\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:07:26 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"relationship\": \"Gandalf strips Saruman of his rank and most of his powers\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Wormtongue throws down a hard round object to try to kill Gandalf\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Pippin picks up the hard round object\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Gandalf swiftly takes the hard round object from Pippin\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"relationship\": \"Pippin steals the hard round object in the night\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"hard round object\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"relationship\": \"The hard round object is a palantír, a seeing-stone\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      " \"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"relationship\": \"Saruman used the palantír to speak with Sauron\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Miscellaneous\", \"name\": \"palantír\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"relationship\": \"Sauron sees Pippin through the palantír\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      " \"relationship\": \"Sauron misunderstands the circumstances of seeing Pippin\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"Gandalf rides for Minas Tirith, taking Pippin with him\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:07:26 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:08:16 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 10\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:08:16 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:08:18 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"relationship\": \"are traveling together\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Frodo is the Ringbearer\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Gollum is obsessed with the Ring and debates stealing it\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Frodo makes Gollum swear to serve him as Ringbearer and guide them to Mordor\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Emyn Muil\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo and Sam travel through the Emyn Muil\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Moria\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Gollum has followed Frodo and Sam from Moria\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum are traveling towards Mordor\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Dead Marshes\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Gollum leads Frodo, Sam, and himself across the Dead Marshes\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Sméagol\"},\n",
      "\"relationship\": \"Sam overhears Gollum (Sméagol) debating with himself\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ithilien\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum travel south through Ithilien\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Henneth Annûn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum are brought to the secret fastness of Henneth Annûn\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Faramir, Boromir's brother, captures Frodo, Sam, and Gollum\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:08:18 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"relationship\": \"are traveling together\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Frodo is the Ringbearer\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Gollum is obsessed with the Ring and debates stealing it\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Frodo makes Gollum swear to serve him as Ringbearer and guide them to Mordor\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Emyn Muil\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo and Sam travel through the Emyn Muil\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Moria\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Gollum has followed Frodo and Sam from Moria\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Mordor\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum are traveling towards Mordor\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Dead Marshes\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"relationship\": \"Gollum leads Frodo, Sam, and himself across the Dead Marshes\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Sméagol\"},\n",
      "\"relationship\": \"Sam overhears Gollum (Sméagol) debating with himself\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Ithilien\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum travel south through Ithilien\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Henneth Annûn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo, Sam, and Gollum are brought to the secret fastness of Henneth Annûn\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Faramir, Boromir's brother, captures Frodo, Sam, and Gollum\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:08:18 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:09:08 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 11\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:09:08 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:09:10 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"strangers\"},\n",
      "\"relationship\": \"Faramir disobeys orders to arrest the strangers\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"hobbits\"},\n",
      "\"relationship\": \"Gollum guides the hobbits\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"pass\"},\n",
      "\"relationship\": \"Gollum leads the hobbits to the pass\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"tunnels of Cirith Ungol\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"great spider\"},\n",
      "\"relationship\": \"The great spider Shelob has a lair in the tunnels of Cirith Ungol\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo holds up the Phial of Galadriel\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"light of Eärendil's star\"},\n",
      "\"relationship\": \"The Phial of Galadriel holds the light of Eärendil's star\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"relationship\": \"The light from the Phial of Galadriel drives Shelob back\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Sting\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"tunnels of Cirith Ungol\"},\n",
      "\"relationship\": \"Sam uses Sting to cut through a giant web in the tunnels of Cirith Ungol\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Shelob attacks Frodo\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Sting\"},\n",
      "\"relationship\": \"Sam picks up Sting\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"relationship\": \"Sam picks up the Phial of Galadriel\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"relationship\": \"Sam wounds Shelob\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"quest\"},\n",
      "\"relationship\": \"Believing Frodo to be dead, Sam takes the Ring to continue the quest alone\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"relationship\": \"Orcs take Frodo\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"relationship\": \"Sam overhears Orcs saying that Frodo is still alive\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:09:10 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"strangers\"},\n",
      "\"relationship\": \"Faramir disobeys orders to arrest the strangers\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"hobbits\"},\n",
      "\"relationship\": \"Gollum guides the hobbits\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"pass\"},\n",
      "\"relationship\": \"Gollum leads the hobbits to the pass\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"tunnels of Cirith Ungol\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"great spider\"},\n",
      "\"relationship\": \"The great spider Shelob has a lair in the tunnels of Cirith Ungol\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Frodo holds up the Phial of Galadriel\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"light of Eärendil's star\"},\n",
      "\"relationship\": \"The Phial of Galadriel holds the light of Eärendil's star\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"relationship\": \"The light from the Phial of Galadriel drives Shelob back\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Sting\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"tunnels of Cirith Ungol\"},\n",
      "\"relationship\": \"Sam uses Sting to cut through a giant web in the tunnels of Cirith Ungol\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Shelob attacks Frodo\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Sting\"},\n",
      "\"relationship\": \"Sam picks up Sting\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Phial of Galadriel\"},\n",
      "\"relationship\": \"Sam picks up the Phial of Galadriel\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Shelob\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"relationship\": \"Sam wounds Shelob\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"quest\"},\n",
      "\"relationship\": \"Believing Frodo to be dead, Sam takes the Ring to continue the quest alone\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"relationship\": \"Orcs take Frodo\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Orcs\"},\n",
      "\"relationship\": \"Sam overhears Orcs saying that Frodo is still alive\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:09:10 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:00 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 12\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:10:00 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:10:02 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"sends a great army against Gondor\"},\n",
      "\"relationship\": \"Sauron is the entity that sends a great army against Gondor\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"relationship\": \"Gandalf arrives at Minas Tirith\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"relationship\": \"Gandalf goes to warn Denethor of the attack\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Riders of Rohan\"},\n",
      "\"relationship\": \"Théoden musters the Riders of Rohan\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"is besieged\"},\n",
      "\"relationship\": \"Minas Tirith is under siege\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Lord of the Nazgûl\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"spell-wound battering ram\"},\n",
      "\"relationship\": \"The Lord of the Nazgûl uses a spell-wound battering ram\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"spell-wound battering ram\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"relationship\": \"The spell-wound battering ram is used to destroy the city's gates\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"falls into despair\"},\n",
      "\"relationship\": \"Denethor falls into despair\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"burns himself alive on a pyre\"},\n",
      "\"relationship\": \"Denethor burns himself alive on a pyre\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"relationship\": \"Pippin and Gandalf rescue Faramir\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Rangers of the North\"},\n",
      "\"relationship\": \"Aragorn is accompanied by the Rangers of the North\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Paths of the Dead\"},\n",
      "\"relationship\": \"Aragorn takes the Paths of the Dead\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Organisation\", \"name\": \"Dead Men of Dunharrow\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"will have no rest until they fight for the King of Gondor\"},\n",
      "\"relationship\": \"The Dead Men of Dunharrow will have no rest until they fight for the King of Gondor\"}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:02 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"sends a great army against Gondor\"},\n",
      "\"relationship\": \"Sauron is the entity that sends a great army against Gondor\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"relationship\": \"Gandalf arrives at Minas Tirith\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"relationship\": \"Gandalf goes to warn Denethor of the attack\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Riders of Rohan\"},\n",
      "\"relationship\": \"Théoden musters the Riders of Rohan\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"is besieged\"},\n",
      "\"relationship\": \"Minas Tirith is under siege\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Lord of the Nazgûl\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"spell-wound battering ram\"},\n",
      "\"relationship\": \"The Lord of the Nazgûl uses a spell-wound battering ram\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"spell-wound battering ram\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      "\"relationship\": \"The spell-wound battering ram is used to destroy the city's gates\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"falls into despair\"},\n",
      "\"relationship\": \"Denethor falls into despair\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Denethor\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"burns himself alive on a pyre\"},\n",
      "\"relationship\": \"Denethor burns himself alive on a pyre\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"relationship\": \"Pippin and Gandalf rescue Faramir\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Organisation\", \"name\": \"Rangers of the North\"},\n",
      "\"relationship\": \"Aragorn is accompanied by the Rangers of the North\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Paths of the Dead\"},\n",
      "\"relationship\": \"Aragorn takes the Paths of the Dead\"},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Organisation\", \"name\": \"Dead Men of Dunharrow\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"will have no rest until they fight for the King of Gondor\"},\n",
      "\"relationship\": \"The Dead Men of Dunharrow will have no rest until they fight for the King of Gondor\"}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:02 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:52 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 13\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:10:52 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:10:55 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor\"},\n",
      " \"relationship\": \"Aragorn is the one who unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Army of the Dead\"},\n",
      " \"relationship\": \"The Army of the Dead is the one unleashed by Aragorn on the Corsairs of Umbar invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Corsairs of Umbar\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"invading southern Gondor\"},\n",
      " \"relationship\": \"The Corsairs of Umbar are the ones invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Corsairs' ships\"},\n",
      " \"relationship\": \"Aragorn sails in the Corsairs' ships.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Corsairs' ships\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"relationship\": \"The Corsairs' ships are used for sailing up the Anduin.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Anduin\"},\n",
      " \"relationship\": \"The event of sailing up the Anduin takes place at the Anduin.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"The event of sailing up the Anduin reaches Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"kills the Lord of the Nazgûl with help from Merry; both are wounded\"},\n",
      " \"relationship\": \"Éowyn kills the Lord of the Nazgûl with help from Merry and both of them are wounded.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      " \"relationship\": \"Théoden is the uncle of Éowyn.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"relationship\": \"Théoden participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gondor\"},\n",
      " \"relationship\": \"Gondor participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Rohan\"},\n",
      " \"relationship\": \"Rohan participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"relationship\": \"Sauron's army is defeated in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"is killed\"},\n",
      " \"relationship\": \"Théoden is killed in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"Aragorn enters Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"heals the sick\"},\n",
      " \"relationship\": \"Aragorn heals the sick in Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Ithilien\"},\n",
      " \"relationship\": \"Aragorn leads an army through Ithilien.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"distracts Sauron from his true danger\"},\n",
      " \"relationship\": \"Aragorn distracts Sauron from his true danger by leading an army through Ithilien.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Morannon\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"relationship\": \"Aragorn's army is vastly outnumbered at the Battle of the Morannon.\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:55 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor\"},\n",
      " \"relationship\": \"Aragorn is the one who unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Army of the Dead\"},\n",
      " \"relationship\": \"The Army of the Dead is the one unleashed by Aragorn on the Corsairs of Umbar invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Corsairs of Umbar\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"invading southern Gondor\"},\n",
      " \"relationship\": \"The Corsairs of Umbar are the ones invading southern Gondor.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Object\", \"name\": \"Corsairs' ships\"},\n",
      " \"relationship\": \"Aragorn sails in the Corsairs' ships.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Object\", \"name\": \"Corsairs' ships\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"relationship\": \"The Corsairs' ships are used for sailing up the Anduin.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Anduin\"},\n",
      " \"relationship\": \"The event of sailing up the Anduin takes place at the Anduin.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"sailing up the Anduin\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"The event of sailing up the Anduin reaches Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"kills the Lord of the Nazgûl with help from Merry; both are wounded\"},\n",
      " \"relationship\": \"Éowyn kills the Lord of the Nazgûl with help from Merry and both of them are wounded.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      " \"relationship\": \"Théoden is the uncle of Éowyn.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"relationship\": \"Théoden participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Gondor\"},\n",
      " \"relationship\": \"Gondor participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Rohan\"},\n",
      " \"relationship\": \"Rohan participates in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Pelennor Fields\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      " \"relationship\": \"Sauron's army is defeated in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"is killed\"},\n",
      " \"relationship\": \"Théoden is killed in the Battle of the Pelennor Fields.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Minas Tirith\"},\n",
      " \"relationship\": \"Aragorn enters Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"heals the sick\"},\n",
      " \"relationship\": \"Aragorn heals the sick in Minas Tirith.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Place\", \"name\": \"Ithilien\"},\n",
      " \"relationship\": \"Aragorn leads an army through Ithilien.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"node_2\": {\"label\": \"Event\", \"name\": \"distracts Sauron from his true danger\"},\n",
      " \"relationship\": \"Aragorn distracts Sauron from his true danger by leading an army through Ithilien.\"\n",
      " },\n",
      " {\n",
      " \"node_1\": {\"label\": \"Event\", \"name\": \"Battle of the Morannon\"},\n",
      " \"node_2\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      " \"relationship\": \"Aragorn's army is vastly outnumbered at the Battle of the Morannon.\"\n",
      " }\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:10:55 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:11:45 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 14\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:11:45 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:11:48 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Sam rescues Frodo from the tower of Cirith Ungol.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"tower of Cirith Ungol\"},\n",
      "\"relationship\": \"Frodo was rescued by Sam from the tower of Cirith Ungol.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Sam and Frodo set out across Mordor together.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Cracks of Doom\"},\n",
      "\"relationship\": \"When Frodo and Sam reach the edge of the Cracks of Doom, Frodo cannot resist the Ring any longer.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Frodo claims the Ring for himself and puts it on.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Gollum reappears and bites off Frodo's Ring finger.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Gollum celebrating wildly, loses his footing and falls into the Fire, taking the Ring with him.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"relationship\": \"When the Ring is destroyed, Sauron loses his power.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"all he created\"},\n",
      "\"relationship\": \"All that Sauron created collapses when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Nazgûl\"},\n",
      "\"relationship\": \"The Nazgûl perish when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"battle of the Morannon\"},\n",
      "\"relationship\": \"Aragorn wins the battle of the Morannon when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Arwen\"},\n",
      "\"relationship\": \"Aragorn weds Arwen, Elrond's daughter.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"burial\"},\n",
      "\"relationship\": \"Théoden is buried.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Éomer\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Rohan\"},\n",
      "\"relationship\": \"Éomer is crowned King of Rohan.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"relationship\": \"Éowyn is engaged to Faramir, now Steward of Gondor and Prince of Ithilien.\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:11:48 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Sam rescues Frodo from the tower of Cirith Ungol.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"tower of Cirith Ungol\"},\n",
      "\"relationship\": \"Frodo was rescued by Sam from the tower of Cirith Ungol.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Sam and Frodo set out across Mordor together.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Cracks of Doom\"},\n",
      "\"relationship\": \"When Frodo and Sam reach the edge of the Cracks of Doom, Frodo cannot resist the Ring any longer.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Frodo claims the Ring for himself and puts it on.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"relationship\": \"Gollum reappears and bites off Frodo's Ring finger.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gollum\"},\n",
      "\"node_2\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"relationship\": \"Gollum celebrating wildly, loses his footing and falls into the Fire, taking the Ring with him.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"relationship\": \"When the Ring is destroyed, Sauron loses his power.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sauron\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"all he created\"},\n",
      "\"relationship\": \"All that Sauron created collapses when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Object\", \"name\": \"Ring\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"Nazgûl\"},\n",
      "\"relationship\": \"The Nazgûl perish when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Event\", \"name\": \"battle of the Morannon\"},\n",
      "\"relationship\": \"Aragorn wins the battle of the Morannon when the Ring is destroyed.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Arwen\"},\n",
      "\"relationship\": \"Aragorn weds Arwen, Elrond's daughter.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Théoden\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"burial\"},\n",
      "\"relationship\": \"Théoden is buried.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Éomer\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Rohan\"},\n",
      "\"relationship\": \"Éomer is crowned King of Rohan.\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Éowyn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Faramir\"},\n",
      "\"relationship\": \"Éowyn is engaged to Faramir, now Steward of Gondor and Prince of Ithilien.\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:11:48 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:12:38 - INFO \u001b[39m\n",
      "\u001b[92mDocument: 15\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:12:38 - INFO \u001b[39m\n",
      "\u001b[34mUsing Ontology:\n",
      "labels=[{'Person': 'Person name without any adjectives, Remember a person may be referenced by their name or using a pronoun'}, {'Object': \"Do not add the definite article 'the' in the object name\"}, {'Event': 'Event event involving multiple people. Do not include qualifiers or verbs like gives, leaves, works etc.'}, 'Place', 'Document', 'Organisation', 'Action', {'Miscellaneous': 'Any important concept can not be categorised with any other given label'}] relationships=['Relation between any pair of Entities']\u001b[39m\n",
      "\u001b[34m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Using Model:  mixtral-8x7b-32768\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO:httpx:HTTP Request: POST https://api.groq.com/openai/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[34m▶︎ GRAPH MAKER VERBOSE - 2024-05-04 19:12:40 - INFO \u001b[39m\n",
      "\u001b[34mLLM Response:\n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"is said farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Four hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Home\"},\n",
      "\"relationship\": \"travel to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Home\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman's men\"},\n",
      "\"relationship\": \"is taken over by\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"raises a rebellion in\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"scours\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"relationship\": \"kills\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Bag End\"},\n",
      "\"relationship\": \"is killed at\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"relationship\": \"are celebrated as\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Rosie Cotton\"},\n",
      "\"relationship\": \"marries\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"uses his gifts to heal\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Grey Havens\"},\n",
      "\"relationship\": \"sails from\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"peace\"},\n",
      "\"relationship\": \"sails over the Sea to find\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[34m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:12:40 - INFO \u001b[39m\n",
      "\u001b[92mTrying JSON Parsing: \n",
      "[\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Galadriel\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Celeborn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Gandalf\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"say farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Aragorn\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Treebeard\"},\n",
      "\"relationship\": \"is said farewell to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Four hobbits\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Home\"},\n",
      "\"relationship\": \"travel to\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Place\", \"name\": \"Home\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman's men\"},\n",
      "\"relationship\": \"is taken over by\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"raises a rebellion in\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"scours\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Saruman\"},\n",
      "\"relationship\": \"kills\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Wormtongue\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"Bag End\"},\n",
      "\"relationship\": \"is killed at\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Merry\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Pippin\"},\n",
      "\"relationship\": \"are celebrated as\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Person\", \"name\": \"Rosie Cotton\"},\n",
      "\"relationship\": \"marries\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Sam\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Shire\"},\n",
      "\"relationship\": \"uses his gifts to heal\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Place\", \"name\": \"The Grey Havens\"},\n",
      "\"relationship\": \"sails from\"\n",
      "},\n",
      "{\n",
      "\"node_1\": {\"label\": \"Person\", \"name\": \"Frodo\"},\n",
      "\"node_2\": {\"label\": \"Miscellaneous\", \"name\": \"peace\"},\n",
      "\"relationship\": \"sails over the Sea to find\"\n",
      "}\n",
      "]\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m\u001b[39m\n",
      "\u001b[92m▶︎ GRAPH MAKER LOG - 2024-05-04 19:12:40 - INFO \u001b[39m\n",
      "\u001b[92mJSON Parsing Successful!\u001b[39m\n",
      "\u001b[92m\u001b[39m\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total number of Edges 200\n"
     ]
    }
   ],
   "source": [
    "\n",
    "graph = graph_maker.from_documents(\n",
    "    list(docs), \n",
    "    delay_s_between=10 ## delay_s_between because otherwise groq api maxes out pretty fast. \n",
    "    ) \n",
    "print(\"Total number of Edges\", len(graph))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'node_1': {'label': 'Person', 'name': 'Bilbo Baggins'}, 'node_2': {'label': 'Event', 'name': 'birthday celebration'}, 'relationship': 'Bilbo Baggins hosts the birthday celebration', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Bilbo Baggins'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Bilbo Baggins leaves the Ring to Frodo', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Bilbo Baggins'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Bilbo Baggins identifies Frodo as his heir', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Gandalf suspects the Ring is a Ring of Power', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Seventeen years later, Gandalf confirms the Ring was lost by the Dark Lord Sauron', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Gandalf counsels Frodo to take the Ring away from the Shire', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Person', 'name': 'Pippin Took'}, 'relationship': 'Frodo sets out on foot with his cousin Pippin Took', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Person', 'name': 'Sam Gamgee'}, 'relationship': 'Frodo sets out on foot with his gardener Sam Gamgee', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Miscellaneous', 'name': 'Black Riders'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'The Black Riders pursue Frodo', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Miscellaneous', 'name': 'Elves'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Black Riders'}, 'relationship': \"The Elves' singing to Elbereth wards off the Riders\", 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Hobbits'}, 'node_2': {'label': 'Place', 'name': 'Bucklebury Ferry'}, 'relationship': 'The Hobbits take an evasive shortcut to Bucklebury Ferry', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry Brandybuck'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Merry meets Frodo at Bucklebury Ferry', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry Brandybuck'}, 'node_2': {'label': 'Person', 'name': 'Pippin Took'}, 'relationship': 'Merry knows Pippin Took', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry Brandybuck'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Merry knows about the Ring', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry Brandybuck'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Merry insists on joining Frodo on his journey', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Pippin Took'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Pippin knows about the Ring', 'metadata': {'summary': \"Bilbo Baggins gives his inherited Ring to Frodo, which Gandalf later confirms as a lost Ring of Power from the Dark Lord Sauron. Gandalf urges Frodo to leave the Shire with it, but after seventeen years, he hasn't returned. Frodo embarks on a journey with his cousin Pippin Took and gardener Sam Gamgee, pursued by Black Riders. They encounter Elves who use singing to protect them, then take a shortcut to Bucklebury Ferry, where they meet Merry Brandybuck. Merry and Pippin, aware of the Ring's significance, insist on joining Frodo's journey.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 0} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Black Riders'}, 'node_2': {'label': 'Event', 'name': 'try to shake off the Black Riders'}, 'relationship': 'The Black Riders are being shaken off', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'try to shake off the Black Riders'}, 'node_2': {'label': 'Place', 'name': 'Old Forest'}, 'relationship': 'The event of shaking off the Black Riders occurs in the Old Forest', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry'}, 'node_2': {'label': 'Person', 'name': 'Pippin'}, 'relationship': 'Merry and Pippin are together', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry and Pippin'}, 'node_2': {'label': 'Event', 'name': 'trapped by the malign Old Man Willow'}, 'relationship': 'Merry and Pippin are trapped by the malign Old Man Willow', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Tom Bombadil'}, 'node_2': {'label': 'Event', 'name': 'rescued by Tom Bombadil'}, 'relationship': 'Tom Bombadil rescues Merry and Pippin', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Tom Bombadil'}, 'node_2': {'label': 'Object', 'name': 'ancient swords'}, 'relationship': 'Tom Bombadil gives ancient swords', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Hobbits'}, 'node_2': {'label': 'Place', 'name': 'village of Bree'}, 'relationship': 'The Hobbits reach the village of Bree', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'innkeeper'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'The innkeeper gives Frodo an old letter', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Strider'}, 'relationship': \"Gandalf's old letter identifies Strider as a friend\", 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Strider'}, 'node_2': {'label': 'Event', 'name': 'guides the group toward the Elvish sanctuary of Rivendell'}, 'relationship': 'Strider guides the group toward the Elvish sanctuary of Rivendell', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Black Riders'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'The Black Riders will attempt to seize the Ring from Frodo', 'metadata': {'summary': \"The Hobbits try to evade the Black Riders by passing through the Old Forest, where Merry and Pippin are captured by Old Man Willow and later rescued by Tom Bombadil. They are subsequently caught by a barrow-wight, but are freed by Tom Bombadil, who also gives them ancient swords. Upon reaching Bree, they meet Strider, a Ranger identified as a friend by Gandalf through an old letter. Aware of the Black Riders' intentions, Strider leads the group towards the Elvish sanctuary of Rivendell.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 1} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Weathertop'}, 'node_2': {'label': 'Event', 'name': 'attacked by five Black Riders'}, 'relationship': 'The event of being attacked by five Black Riders occurred at Weathertop.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Action', 'name': 'wounds'}, 'relationship': 'A Black Rider wounded Frodo with a cursed blade during the attack at Weathertop.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Strider'}, 'node_2': {'label': 'Action', 'name': 'fights off'}, 'relationship': 'Strider fought off the Black Riders during the attack at Weathertop.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Strider'}, 'node_2': {'label': 'Action', 'name': 'treats'}, 'relationship': 'Strider treated Frodo with the herb athelas after the attack at Weathertop.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Glorfindel'}, 'node_2': {'label': 'Action', 'name': 'rides with'}, 'relationship': 'Glorfindel rode with Frodo towards Rivendell after the attack at Weathertop.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Ford of Bruinen'}, 'node_2': {'label': 'Event', 'name': 'pursue Frodo'}, 'relationship': 'The Black Riders pursued Frodo towards the Ford of Bruinen.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Ford of Bruinen'}, 'node_2': {'label': 'Event', 'name': 'swept away'}, 'relationship': 'The Black Riders were swept away by flood waters at the Ford of Bruinen.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Place', 'name': 'Rivendell'}, 'relationship': \"Frodo recovered in Rivendell under Elrond's care after being wounded by the Black Rider.\", 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Gandalf informed Frodo that the Black Riders are the Nazgûl, Men enslaved by Rings of Power to serve Sauron.', 'metadata': {'summary': \"At Weathertop, Frodo is wounded by a Black Rider's cursed blade. Strider fights off the five pursuing Nazgûl, and they continue to Rivendell with the elf Glorfindel. Pursued by the Nazgûl, they reach the Ford of Bruinen, where Elrond summons flood waters that sweep the Nazgûl away. Frodo recovers in Rivendell under Elrond's care, while Gandalf reveals the Black Riders to be Sauron's enslaved servants, the Nazgûl.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 2} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Council of Elrond'}, 'node_2': {'label': 'Event', 'name': 'discusses what to do with the Ring'}, 'relationship': 'The Council of Elrond is discussing the matter of what to do with the Ring.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Strider'}, 'node_2': {'label': 'Person', 'name': 'Aragorn'}, 'relationship': 'Strider is revealed to be Aragorn.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Isildur'}, 'relationship': 'Aragorn is the heir of Isildur.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Isildur'}, 'node_2': {'label': 'Action', 'name': \"cut the Ring from Sauron's hand\"}, 'relationship': \"Isildur had cut the Ring from Sauron's hand.\", 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': \"cut the Ring from Sauron's hand\"}, 'node_2': {'label': 'Time', 'name': 'Second Age'}, 'relationship': \"The event of cutting the Ring from Sauron's hand occurred during the Second Age.\", 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Isildur'}, 'node_2': {'label': 'Action', 'name': 'claimed the Ring for himself'}, 'relationship': \"Isildur claimed the Ring for himself after cutting it from Sauron's hand.\", 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Ring'}, 'node_2': {'label': 'Person', 'name': 'Isildur'}, 'relationship': 'The Ring was lost when Isildur was killed.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Ring'}, 'node_2': {'label': 'Person', 'name': 'Gollum'}, 'relationship': \"The Ring passed to Gollum after Isildur's death.\", 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Ring'}, 'node_2': {'label': 'Person', 'name': 'Bilbo'}, 'relationship': 'The Ring then passed to Bilbo from Gollum.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Saruman'}, 'relationship': 'Gandalf reports that the chief wizard, Saruman, is a traitor.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'destroy the Ring'}, 'node_2': {'label': 'Place', 'name': 'Mount Doom'}, 'relationship': 'The Council decides that the Ring must be destroyed in the fire of Mount Doom.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Action', 'name': 'destroy the Ring'}, 'relationship': 'Frodo takes the task of destroying the Ring upon himself.', 'metadata': {'summary': 'In the Council of Elrond, it is decided that the One Ring must be destroyed in Mount Doom to defeat Sauron. Aragorn is revealed to be the heir of Isildur, who originally took the Ring. It has since passed from Isildur to Gollum and then to Bilbo. Gandalf reveals that Saruman is a traitor. Frodo volunteers to complete the dangerous mission of destroying the Ring.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 3} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Elrond'}, 'node_2': {'label': 'Miscellaneous', 'name': 'companions'}, 'relationship': 'Elrond chooses companions for him', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Elrond'}, 'node_2': {'label': 'Person', 'name': 'Sam'}, 'relationship': 'Elrond chooses Sam as one of his companions', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Elrond'}, 'node_2': {'label': 'Person', 'name': 'Merry'}, 'relationship': 'Elrond chooses Merry as one of his companions', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Elrond'}, 'node_2': {'label': 'Person', 'name': 'Pippin'}, 'relationship': 'Elrond chooses Pippin as one of his companions', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Elrond'}, 'relationship': 'Gandalf is one of the companions chosen by Elrond', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Elrond'}, 'relationship': 'Aragorn is one of the companions chosen by Elrond', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Boromir'}, 'node_2': {'label': 'Person', 'name': 'Elrond'}, 'relationship': 'Boromir is one of the companions chosen by Elrond', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Legolas'}, 'node_2': {'label': 'Person', 'name': 'Elrond'}, 'relationship': 'Legolas is one of the companions chosen by Elrond', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gimli'}, 'node_2': {'label': 'Person', 'name': 'Elrond'}, 'relationship': 'Gimli is one of the companions chosen by Elrond', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Misty Mountains'}, 'node_2': {'label': 'Person', 'name': 'Fellowship'}, 'relationship': 'The Fellowship attempts to cross the Misty Mountains', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Mines of Moria'}, 'node_2': {'label': 'Person', 'name': 'Fellowship'}, 'relationship': 'The Fellowship risks the path through the Mines of Moria', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Balin'}, 'node_2': {'label': 'Place', 'name': 'Mines of Moria'}, 'relationship': 'Balin and his Dwarves were killed by Orcs in the Mines of Moria', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Orcs'}, 'node_2': {'label': 'Person', 'name': 'Fellowship'}, 'relationship': 'The Fellowship is attacked by Orcs', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Balrog'}, 'node_2': {'label': 'Person', 'name': 'Fellowship'}, 'relationship': 'The Fellowship is attacked by a Balrog', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Object', 'name': 'Balrog'}, 'relationship': 'Gandalf confronts the Balrog', 'metadata': {'summary': 'Elrond selects companions for a journey to destroy the One Ring, including representatives from different races. The group, known as the Fellowship, faces challenges and is attacked by Orcs in the Mines of Moria, where they discover that Balin and his Dwarves were killed. A Balrog appears and Gandalf sacrifices himself to let the others escape, falling into an abyss with the demon.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 4} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'the others'}, 'node_2': {'label': 'Place', 'name': 'Elvish forest of Lothlórien'}, 'relationship': 'escape to', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Lady Galadriel'}, 'node_2': {'label': 'Place', 'name': 'Elvish forest of Lothlórien'}, 'relationship': 'tests their loyalty in and gives them magical gifts at', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Lady Galadriel'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'allows to look into her vision-giving fountain, the Mirror of Galadriel', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Miscellaneous', 'name': 'the Ring'}, 'relationship': 'offers to Lady Galadriel', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Lady Galadriel'}, 'node_2': {'label': 'Miscellaneous', 'name': 'the Ring'}, 'relationship': 'refuses, knowing that it would master her', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Celeborn'}, 'node_2': {'label': 'Person', 'name': 'the Fellowship'}, 'relationship': 'gives boats, cloaks, and waybread to', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Boromir'}, 'node_2': {'label': 'Miscellaneous', 'name': 'the Ring'}, 'relationship': 'tries to take', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Action', 'name': 'puts on the Ring'}, 'relationship': 'and disappears', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Place', 'name': 'Mordor'}, 'relationship': 'chooses to cross the river and go alone to', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'guessing what he intends, intercepts him', 'metadata': {'summary': 'The group escapes to Lothlórien, where Galadriel tests their loyalty and gives them gifts. They visit the Mirror of Galadriel, and Frodo offers her the Ring, but she refuses. Celeborn gives them supplies for their journey. While at Amon Hen, Boromir attempts to take the Ring, and Frodo decides to go to Mordor alone, but Sam follows him.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 5} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Orcs'}, 'node_2': {'label': 'Event', 'name': 'attack the Fellowship'}, 'relationship': 'The Orcs are the entities that carry out the attack on the Fellowship', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Boromir'}, 'node_2': {'label': 'Person', 'name': 'Merry'}, 'relationship': 'Boromir tries to protect Merry from the Orcs', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Boromir'}, 'node_2': {'label': 'Person', 'name': 'Pippin'}, 'relationship': 'Boromir also tries to protect Pippin from the Orcs', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Orcs'}, 'node_2': {'label': 'Person', 'name': 'Boromir'}, 'relationship': 'The Orcs kill Boromir', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Orcs'}, 'node_2': {'label': 'Person', 'name': 'Merry'}, 'relationship': 'The Orcs capture Merry and Pippin', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Gimli'}, 'relationship': 'Aragorn and Gimli decide to pursue the Orcs', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Legolas'}, 'node_2': {'label': 'Person', 'name': 'Aragorn'}, 'relationship': 'Legolas joins Aragorn and Gimli in pursuing the Orcs', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Orcs'}, 'node_2': {'label': 'Person', 'name': 'Riders of Rohan'}, 'relationship': 'The Orcs are killed by the Riders of Rohan', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Riders of Rohan'}, 'node_2': {'label': 'Person', 'name': 'Éomer'}, 'relationship': 'The Riders of Rohan are led by Éomer', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Hobbits'}, 'node_2': {'label': 'Place', 'name': 'Fangorn Forest'}, 'relationship': 'The Hobbits escape into Fangorn Forest', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Hobbits'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Ent Treebeard'}, 'relationship': 'The Hobbits are befriended by Ent Treebeard in Fangorn Forest', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Gimli'}, 'relationship': 'Aragorn and Gimli track the Hobbits to Fangorn', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Legolas'}, 'node_2': {'label': 'Person', 'name': 'Aragorn'}, 'relationship': 'Legolas also joins Aragorn and Gimli in tracking the Hobbits to Fangorn', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Balrog'}, 'relationship': 'Gandalf explains that he killed the Balrog', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Gandalf'}, 'relationship': 'Gandalf was killed in the fight with the Balrog, but was sent back to Middle-earth', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf the White'}, 'node_2': {'label': 'Person', 'name': 'Saruman'}, 'relationship': 'Gandalf the White replaces Saruman as chief of the wizards', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Place', 'name': 'Edoras'}, 'relationship': 'Gandalf rides to Edoras, capital of Rohan', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Théoden'}, 'relationship': \"Gandalf frees King Théoden from the influence of Saruman's spy Gríma Wormtongue\", 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Théoden'}, 'node_2': {'label': 'Place', 'name': \"Helm's Deep\"}, 'relationship': \"Théoden musters his army and rides to the fortress of Helm's Deep\", 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Treebeard'}, 'relationship': 'Gandalf departs to seek help from Treebeard', 'metadata': {'summary': \"Orcs sent by Saruman and Sauron attack the Fellowship, killing Boromir and capturing Merry and Pippin. Aragorn, Gimli, and Legolas pursue the Orcs, who are killed by Rohan's Riders, while the Hobbits escape into Fangorn Forest and are befriended by Treebeard. The trio tracks the Hobbits to Fangorn, reuniting with a reborn Gandalf the White. They go to Rohan's capital, Edoras, where Gandalf frees King Théoden from Saruman's spy, Gríma. Théoden musters his army and rides to Helm's Deep for defense; Gandalf departs to seek help from Treebeard.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 6} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Ents'}, 'node_2': {'label': 'Place', 'name': 'Isengard'}, 'relationship': \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\", 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Saruman'}, 'node_2': {'label': 'Place', 'name': 'Orthanc'}, 'relationship': \"The Ents destroy Isengard, Saruman's stronghold, and flood it, trapping the wizard in the tower of Orthanc.\", 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Treebeard'}, 'relationship': \"Gandalf convinces Treebeard to send an army of Huorns to Théoden's aid.\", 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Organisation', 'name': 'Riders of Rohan'}, 'relationship': \"He brings an army of Riders of Rohan to Helm's Deep.\", 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Organisation', 'name': 'Orcs'}, 'node_2': {'label': 'Place', 'name': 'forest of Huorns'}, 'relationship': 'The Orcs flee into the forest of Huorns and are destroyed.', 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Théoden'}, 'relationship': 'Gandalf, Théoden, Aragorn, Legolas, and Gimli ride to Isengard,', 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Merry'}, 'relationship': 'They find Merry and Pippin relaxing amidst the ruins.', 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Saruman'}, 'relationship': 'Gandalf offers Saruman a chance to turn away from evil.', 'metadata': {'summary': \"After the Ents destroy Isengard, Gandalf leads Huorns and Rohirrim to Helm's Deep, defeating Orcs. They find Merry and Pippin at Isengard, and Gandalf gives Saruman a chance to redeem.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 7} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Saruman'}, 'node_2': {'label': 'Person', 'name': 'Gandalf'}, 'relationship': 'Gandalf strips Saruman of his rank and most of his powers', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Wormtongue'}, 'node_2': {'label': 'Miscellaneous', 'name': 'hard round object'}, 'relationship': 'Wormtongue throws down a hard round object to try to kill Gandalf', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Pippin'}, 'node_2': {'label': 'Miscellaneous', 'name': 'hard round object'}, 'relationship': 'Pippin picks up the hard round object', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Miscellaneous', 'name': 'hard round object'}, 'relationship': 'Gandalf swiftly takes the hard round object from Pippin', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Pippin'}, 'node_2': {'label': 'Miscellaneous', 'name': 'hard round object'}, 'relationship': 'Pippin steals the hard round object in the night', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Miscellaneous', 'name': 'hard round object'}, 'node_2': {'label': 'Miscellaneous', 'name': 'palantír'}, 'relationship': 'The hard round object is a palantír, a seeing-stone', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Saruman'}, 'node_2': {'label': 'Miscellaneous', 'name': 'palantír'}, 'relationship': 'Saruman used the palantír to speak with Sauron', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Miscellaneous', 'name': 'palantír'}, 'node_2': {'label': 'Person', 'name': 'Sauron'}, 'relationship': 'Sauron sees Pippin through the palantír', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sauron'}, 'node_2': {'label': 'Person', 'name': 'Pippin'}, 'relationship': 'Sauron misunderstands the circumstances of seeing Pippin', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Place', 'name': 'Minas Tirith'}, 'relationship': 'Gandalf rides for Minas Tirith, taking Pippin with him', 'metadata': {'summary': 'Gandalf demotes Saruman, who then tries to kill Gandalf with a palantír that he used to communicate with Sauron. Pippin steals the palantír, and Sauron sees Pippin but misunderstands the situation. Gandalf takes Pippin and rushes to Minas Tirith, the main city of Gondor.', 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 8} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Person', 'name': 'Sam'}, 'relationship': 'are traveling together', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Frodo is the Ringbearer', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gollum'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Gollum is obsessed with the Ring and debates stealing it', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Person', 'name': 'Gollum'}, 'relationship': 'Frodo makes Gollum swear to serve him as Ringbearer and guide them to Mordor', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Emyn Muil'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Frodo and Sam travel through the Emyn Muil', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Moria'}, 'node_2': {'label': 'Person', 'name': 'Gollum'}, 'relationship': 'Gollum has followed Frodo and Sam from Moria', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Mordor'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Frodo, Sam, and Gollum are traveling towards Mordor', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Dead Marshes'}, 'node_2': {'label': 'Person', 'name': 'Gollum'}, 'relationship': 'Gollum leads Frodo, Sam, and himself across the Dead Marshes', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Sméagol'}, 'relationship': 'Sam overhears Gollum (Sméagol) debating with himself', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Ithilien'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Frodo, Sam, and Gollum travel south through Ithilien', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Henneth Annûn'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Frodo, Sam, and Gollum are brought to the secret fastness of Henneth Annûn', 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Faramir'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': \"Faramir, Boromir's brother, captures Frodo, Sam, and Gollum\", 'metadata': {'summary': \"Frodo and Sam encounter and capture Gollum in the Emyn Muil, making him guide them to Mordor. They travel through the Dead Marshes and are led south through Ithilien by Gollum to a secret pass. They are captured by rangers led by Faramir, Boromir's brother, and brought to the secret fortress of Henneth Annûn. During their journey, Sam overhears Gollum's internal conflict regarding the Ring.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 9} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Faramir'}, 'node_2': {'label': 'Person', 'name': 'strangers'}, 'relationship': 'Faramir disobeys orders to arrest the strangers', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gollum'}, 'node_2': {'label': 'Person', 'name': 'hobbits'}, 'relationship': 'Gollum guides the hobbits', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'hobbits'}, 'node_2': {'label': 'Place', 'name': 'pass'}, 'relationship': 'Gollum leads the hobbits to the pass', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'tunnels of Cirith Ungol'}, 'node_2': {'label': 'Object', 'name': 'great spider'}, 'relationship': 'The great spider Shelob has a lair in the tunnels of Cirith Ungol', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Phial of Galadriel'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Frodo holds up the Phial of Galadriel', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Phial of Galadriel'}, 'node_2': {'label': 'Object', 'name': \"light of Eärendil's star\"}, 'relationship': \"The Phial of Galadriel holds the light of Eärendil's star\", 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Phial of Galadriel'}, 'node_2': {'label': 'Object', 'name': 'Shelob'}, 'relationship': 'The light from the Phial of Galadriel drives Shelob back', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Sting'}, 'node_2': {'label': 'Place', 'name': 'tunnels of Cirith Ungol'}, 'relationship': 'Sam uses Sting to cut through a giant web in the tunnels of Cirith Ungol', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Shelob'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Shelob attacks Frodo', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Object', 'name': 'Sting'}, 'relationship': 'Sam picks up Sting', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Object', 'name': 'Phial of Galadriel'}, 'relationship': 'Sam picks up the Phial of Galadriel', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Shelob'}, 'node_2': {'label': 'Person', 'name': 'Sam'}, 'relationship': 'Sam wounds Shelob', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Miscellaneous', 'name': 'quest'}, 'relationship': 'Believing Frodo to be dead, Sam takes the Ring to continue the quest alone', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Organisation', 'name': 'Orcs'}, 'relationship': 'Orcs take Frodo', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Organisation', 'name': 'Orcs'}, 'relationship': 'Sam overhears Orcs saying that Frodo is still alive', 'metadata': {'summary': \"Faramir refrains from taking the Ring and releases Frodo and Sam. Gollum leads them to Shelob's lair, where Frodo uses the Phial of Galadriel to drive her back. Frodo is wounded by Shelob's venom, and Sam, believing Frodo to be dead, takes the Ring to continue the quest. Orcs capture Frodo, but Sam overhears them saying that Frodo is still alive.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 10} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sauron'}, 'node_2': {'label': 'Event', 'name': 'sends a great army against Gondor'}, 'relationship': 'Sauron is the entity that sends a great army against Gondor', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Place', 'name': 'Minas Tirith'}, 'relationship': 'Gandalf arrives at Minas Tirith', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Denethor'}, 'relationship': 'Gandalf goes to warn Denethor of the attack', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Théoden'}, 'node_2': {'label': 'Organisation', 'name': 'Riders of Rohan'}, 'relationship': 'Théoden musters the Riders of Rohan', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Minas Tirith'}, 'node_2': {'label': 'Event', 'name': 'is besieged'}, 'relationship': 'Minas Tirith is under siege', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Lord of the Nazgûl'}, 'node_2': {'label': 'Object', 'name': 'spell-wound battering ram'}, 'relationship': 'The Lord of the Nazgûl uses a spell-wound battering ram', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'spell-wound battering ram'}, 'node_2': {'label': 'Place', 'name': 'Minas Tirith'}, 'relationship': \"The spell-wound battering ram is used to destroy the city's gates\", 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Denethor'}, 'node_2': {'label': 'Event', 'name': 'falls into despair'}, 'relationship': 'Denethor falls into despair', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Denethor'}, 'node_2': {'label': 'Event', 'name': 'burns himself alive on a pyre'}, 'relationship': 'Denethor burns himself alive on a pyre', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Pippin'}, 'node_2': {'label': 'Person', 'name': 'Faramir'}, 'relationship': 'Pippin and Gandalf rescue Faramir', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Organisation', 'name': 'Rangers of the North'}, 'relationship': 'Aragorn is accompanied by the Rangers of the North', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Object', 'name': 'Paths of the Dead'}, 'relationship': 'Aragorn takes the Paths of the Dead', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Organisation', 'name': 'Dead Men of Dunharrow'}, 'node_2': {'label': 'Event', 'name': 'will have no rest until they fight for the King of Gondor'}, 'relationship': 'The Dead Men of Dunharrow will have no rest until they fight for the King of Gondor', 'metadata': {'summary': \"Sauron attacks Gondor, and Gandalf warns Denethor of the impending assault while Theoden gathers the Rohirrim to help. Minas Tirith is besieged, and the Lord of the Nazgûl breaches the city's gates. Denethor, misled by Sauron, falls into despair and kills himself, but Gandalf and Pippin save his son Faramir. Aragorn leads Legolas, Gimli, and the Rangers of the North through the Paths of the Dead to enlist the aid of the Dead Men of Dunharrow.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 11} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Event', 'name': 'unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor'}, 'relationship': 'Aragorn is the one who unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'unleashes the Army of the Dead on the Corsairs of Umbar invading southern Gondor'}, 'node_2': {'label': 'Object', 'name': 'Army of the Dead'}, 'relationship': 'The Army of the Dead is the one unleashed by Aragorn on the Corsairs of Umbar invading southern Gondor.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Corsairs of Umbar'}, 'node_2': {'label': 'Event', 'name': 'invading southern Gondor'}, 'relationship': 'The Corsairs of Umbar are the ones invading southern Gondor.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Object', 'name': \"Corsairs' ships\"}, 'relationship': \"Aragorn sails in the Corsairs' ships.\", 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': \"Corsairs' ships\"}, 'node_2': {'label': 'Event', 'name': 'sailing up the Anduin'}, 'relationship': \"The Corsairs' ships are used for sailing up the Anduin.\", 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'sailing up the Anduin'}, 'node_2': {'label': 'Place', 'name': 'Anduin'}, 'relationship': 'The event of sailing up the Anduin takes place at the Anduin.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'sailing up the Anduin'}, 'node_2': {'label': 'Place', 'name': 'Minas Tirith'}, 'relationship': 'The event of sailing up the Anduin reaches Minas Tirith.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Éowyn'}, 'node_2': {'label': 'Event', 'name': 'kills the Lord of the Nazgûl with help from Merry; both are wounded'}, 'relationship': 'Éowyn kills the Lord of the Nazgûl with help from Merry and both of them are wounded.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Théoden'}, 'node_2': {'label': 'Person', 'name': 'Éowyn'}, 'relationship': 'Théoden is the uncle of Éowyn.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'Battle of the Pelennor Fields'}, 'node_2': {'label': 'Person', 'name': 'Théoden'}, 'relationship': 'Théoden participates in the Battle of the Pelennor Fields.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'Battle of the Pelennor Fields'}, 'node_2': {'label': 'Person', 'name': 'Gondor'}, 'relationship': 'Gondor participates in the Battle of the Pelennor Fields.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'Battle of the Pelennor Fields'}, 'node_2': {'label': 'Person', 'name': 'Rohan'}, 'relationship': 'Rohan participates in the Battle of the Pelennor Fields.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'Battle of the Pelennor Fields'}, 'node_2': {'label': 'Person', 'name': 'Sauron'}, 'relationship': \"Sauron's army is defeated in the Battle of the Pelennor Fields.\", 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Théoden'}, 'node_2': {'label': 'Event', 'name': 'is killed'}, 'relationship': 'Théoden is killed in the Battle of the Pelennor Fields.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Place', 'name': 'Minas Tirith'}, 'relationship': 'Aragorn enters Minas Tirith.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Event', 'name': 'heals the sick'}, 'relationship': 'Aragorn heals the sick in Minas Tirith.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Place', 'name': 'Ithilien'}, 'relationship': 'Aragorn leads an army through Ithilien.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Event', 'name': 'distracts Sauron from his true danger'}, 'relationship': 'Aragorn distracts Sauron from his true danger by leading an army through Ithilien.', 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Event', 'name': 'Battle of the Morannon'}, 'node_2': {'label': 'Person', 'name': 'Aragorn'}, 'relationship': \"Aragorn's army is vastly outnumbered at the Battle of the Morannon.\", 'metadata': {'summary': \"Aragorn leads the Army of the Dead to defeat the Corsairs of Umbar, allowing them to sail up Anduin and reach Minas Tirith in time to aid in the Battle of the Pelennor Fields. Éowyn, disguised as a man, kills the Lord of the Nazgûl with Merry's help but both are wounded. Théoden is killed in the battle, but Gondor and Rohan emerge victorious. Aragorn heals the sick in Minas Tirith and leads an army to the Black Gate to distract Sauron while the true threat approaches. At the Battle of the Morannon, his army is significantly outnumbered.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 12} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Sam rescues Frodo from the tower of Cirith Ungol.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Place', 'name': 'tower of Cirith Ungol'}, 'relationship': 'Frodo was rescued by Sam from the tower of Cirith Ungol.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': 'Sam and Frodo set out across Mordor together.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Place', 'name': 'Cracks of Doom'}, 'relationship': 'When Frodo and Sam reach the edge of the Cracks of Doom, Frodo cannot resist the Ring any longer.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Frodo claims the Ring for himself and puts it on.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gollum'}, 'node_2': {'label': 'Person', 'name': 'Frodo'}, 'relationship': \"Gollum reappears and bites off Frodo's Ring finger.\", 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gollum'}, 'node_2': {'label': 'Object', 'name': 'Ring'}, 'relationship': 'Gollum celebrating wildly, loses his footing and falls into the Fire, taking the Ring with him.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Ring'}, 'node_2': {'label': 'Person', 'name': 'Sauron'}, 'relationship': 'When the Ring is destroyed, Sauron loses his power.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sauron'}, 'node_2': {'label': 'Miscellaneous', 'name': 'all he created'}, 'relationship': 'All that Sauron created collapses when the Ring is destroyed.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Object', 'name': 'Ring'}, 'node_2': {'label': 'Miscellaneous', 'name': 'Nazgûl'}, 'relationship': 'The Nazgûl perish when the Ring is destroyed.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Event', 'name': 'battle of the Morannon'}, 'relationship': 'Aragorn wins the battle of the Morannon when the Ring is destroyed.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Arwen'}, 'relationship': \"Aragorn weds Arwen, Elrond's daughter.\", 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Théoden'}, 'node_2': {'label': 'Miscellaneous', 'name': 'burial'}, 'relationship': 'Théoden is buried.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Éomer'}, 'node_2': {'label': 'Place', 'name': 'Rohan'}, 'relationship': 'Éomer is crowned King of Rohan.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Éowyn'}, 'node_2': {'label': 'Person', 'name': 'Faramir'}, 'relationship': 'Éowyn is engaged to Faramir, now Steward of Gondor and Prince of Ithilien.', 'metadata': {'summary': \"Frodo and Sam continue their journey in Mordor, but Frodo claims the Ring and is attacked by Gollum, who falls into the Fire with the Ring, causing Sauron's downfall. Aragorn wins the final battle, is crowned King, and marries Arwen. Éomer becomes King of Rohan, and Éowyn is engaged to Faramir, the new Steward of Gondor.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 13} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Galadriel'}, 'node_2': {'label': 'Person', 'name': 'Treebeard'}, 'relationship': 'say farewell to', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Celeborn'}, 'node_2': {'label': 'Person', 'name': 'Treebeard'}, 'relationship': 'say farewell to', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Gandalf'}, 'node_2': {'label': 'Person', 'name': 'Treebeard'}, 'relationship': 'say farewell to', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Aragorn'}, 'node_2': {'label': 'Person', 'name': 'Treebeard'}, 'relationship': 'is said farewell to', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Four hobbits'}, 'node_2': {'label': 'Place', 'name': 'Home'}, 'relationship': 'travel to', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Place', 'name': 'Home'}, 'node_2': {'label': 'Person', 'name': \"Saruman's men\"}, 'relationship': 'is taken over by', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry'}, 'node_2': {'label': 'Place', 'name': 'The Shire'}, 'relationship': 'raises a rebellion in', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry'}, 'node_2': {'label': 'Place', 'name': 'The Shire'}, 'relationship': 'scours', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Wormtongue'}, 'node_2': {'label': 'Person', 'name': 'Saruman'}, 'relationship': 'kills', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Wormtongue'}, 'node_2': {'label': 'Place', 'name': 'Bag End'}, 'relationship': 'is killed at', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Merry'}, 'node_2': {'label': 'Person', 'name': 'Pippin'}, 'relationship': 'are celebrated as', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Person', 'name': 'Rosie Cotton'}, 'relationship': 'marries', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Sam'}, 'node_2': {'label': 'Place', 'name': 'The Shire'}, 'relationship': 'uses his gifts to heal', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Place', 'name': 'The Grey Havens'}, 'relationship': 'sails from', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n",
      "{'node_1': {'label': 'Person', 'name': 'Frodo'}, 'node_2': {'label': 'Miscellaneous', 'name': 'peace'}, 'relationship': 'sails over the Sea to find', 'metadata': {'summary': \"After saying farewell to their companions, the four hobbits return to the Shire and discover it's been overtaken by Saruman's men. Merry leads a rebellion to reclaim their land, while Sam marries Rosie Cotton and uses his gifts to heal the Shire. Frodo, traumatized by the quest, leaves for the Grey Havens a few years later, seeking peace over the Sea. Saruman is killed by Wormtongue, who is then killed by hobbit archers. Merry and Pippin are hailed as heroes.\", 'generated_at': '2024-05-04 18:59:00.570860'}, 'order': 14} \n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "for edge in graph:\n",
    "    print(edge.model_dump(), \"\\n\\n\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Save the Graph to Neo4j "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n",
      "aenter called\n",
      "aexit called\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from graph_maker import Neo4jGraphModel\n",
    "\n",
    "create_indices = False\n",
    "neo4j_graph = Neo4jGraphModel(edges=graph, create_indices=create_indices)\n",
    "\n",
    "neo4j_graph.save()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
